<template>
	<view>
		<view class="search">
			<view class="search-content">
				<u-search bg-color="white" v-model="value" :show-action="false" :placeholder="placeholder"
					:focus="true">
				</u-search>
				<view class="btn-search" @click="handleSearch">搜索</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		props: {
			placeholder: {
				type: String,
				default: '请输入内容'
			},
			model: ""
		},
		data() {
			return {
				value: ''
			}
		},
		watch: {
			value(val) {
				this.$emit('search', val)
			},
		},
		mounted() {
			
		},
		methods: {
			handleSearch() {
				this.$emit('search', this.value)
			}
		}
	};
</script>

<style lang="scss" scoped>
	.search {
		height: 50px;
		display: flex;
		align-items: center;
		padding: 0 10px;

		.search-content {
			display: flex;
			align-items: center;
			flex: 1;
			border-radius: 45px;
			padding: 0 7px 0 0;
			background-color: white;
		}

		.btn-search {
			border-radius: 15px;
			background-color: rgb(95, 205, 234);
			padding: 3px 15px;
			color: white;
			// width: 60px;
		}
	}
</style>